<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8"> 
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
  <title>发行市场</title> 
  <link rel="stylesheet" href="http://cdn.lezhibo.com/staticPublish/portal/layui/css/layui.css?cdnv=0.16"> 
  <link rel="stylesheet" href="http://cdn.lezhibo.com/staticPublish/portal/css/le-main1.css?cdnv=0.16"> 
  <link rel="stylesheet" href="http://cdn.lezhibo.com/staticPublish/portal/css/alliance-market.css?cdnv=0.16"> 
  <link rel="stylesheet" href="http://cdn.lezhibo.com/staticPublish/portal/font-awesome-4.7.0/css/font-awesome.min.css?cdnv=0.16"> 
  <style type="text/css">
        .select_sidebar_child{
            background-color: #2D93CA;
        }
    </style> 
 </head> 
 <body> 
  <div class="le-main"> 
   <div class="le-head"> 
    <div class="le-head-content"> 
     <div class="le-head-logo">
      <a href="#"><img src="http://cdn.lezhibo.com/staticPortal/portal/img/lelive-logo1.jpg"></a>
     </div> 
     <div class="le-head-nav"> 
      <ul class="layui-nav le-nav"> 
       <li class="layui-nav-item" id="nav-index"><a href="/portal">直播活动</a></li> 
       <li class="layui-nav-item" id="nav-videoClip"><a href="http://www.lezhibo.com/videoClip/portal">小视频</a></li> 
       <li class="layui-nav-item" id="nav-mcloud"><a href="/portal/mediacloud">媒体云</a></li> 
       <li class="layui-nav-item" id="nav-shop"><a href="/portal/shop">商城</a></li> 
       <li class="layui-nav-item" id="nav-device"><a href="/portal/device">硬件设备</a></li> 
       <li class="layui-nav-item" id="nav-liveroom"><a href="/portal/liveroom/info?id=d9c6afa2e0b649afbd56d3c10e6ffc3d">直播间</a></li> 
       <li class="layui-nav-item layui-this"><a href="/portal/publish">联盟市场</a></li> 
      </ul> 
     </div> 
     <div class="le-head-personal" style="width: 10%"> 
      <ul class="le-head-icon"> 
       <li class="le-head-icon-bell"> <a href="/portal/center/message"> <i class="fa fa-bell fa-lg" aria-hidden="true"></i> </a> <span class="bell-mark"><i class="fa fa-circle" aria-hidden="true"></i></span> </li> 
       <!--<li><a href=""><i class="fa fa-server fa-lg" aria-hidden="true"></i></a></li>
                <li><a href="http://www.lezhibo.com/portal/center"><i class="fa fa-user-circle fa-lg" aria-hidden="true"></i></a></li>--> 
       <li><a href="/portal/center"> <img src="http://cdn.lezhibo.com/staticPortal/portal/img/avatar.jpg"> </a></li> 
      </ul> 
     </div> 
    </div> 
   </div> 
   <div class="le-content-wrap le-head-content"> 
    <div class="le-sidebar"> 
     <ul class="layui-nav layui-nav-tree"> 
      <li class="layui-nav-item" id="market"> <a href="javascript:void(0);" onclick="setItem()"><i class="fa fa-clock-o" aria-hidden="true"></i>&nbsp;发行</a> 
       <dl class="layui-nav-child"> 
        <dd id="publishMarket">
         <a href="/portal/publish">发行市场</a>
        </dd> 
        <dd id="reproduceMarket">
         <a href="/reproduce/portal">转播市场</a>
        </dd> 
       </dl> </li> 
      <li class="layui-nav-item" id="mine"> <a href="javascript:void(0);" onclick="setItem()"><i class="fa fa-user-plus" aria-hidden="true"></i>&nbsp;我的</a> 
       <dl class="layui-nav-child"> 
        <dd id="myPublish">
         <a href="/portal/publish/put">我的发行</a>
        </dd> 
        <dd id="myReproduce">
         <a href="/reproduce/portal/myApplyReproduce">我的转播</a>
        </dd> 
       </dl> </li> 
     </ul> 
    </div> 
    <div class="le-content"> 
     <div class="le-mall-content"> 
      <div> 
       <a href="#"><button class="layui-btn" id="publicChannel">发布资源</button></a> 
       <a href="/portal/publish/myResourse?companyVoId=09fbf681da48484b9e3b54816fde728a" class="color-default">我的资源</a> 
       <a href="/portal/publish/batchPublish"><button class="layui-btn pull-right" style="margin-right:18px">批量发行</button></a> 
      </div> 
      <div class="le-more mr2"> 
       <ul class="ul-filter fix" id="aa"> 
        <li>类型：</li> 
        <li> <a id="type0" href="/portal/publish?type=0
">不限</a> </li> 
        <li> <a id="type1" href="/portal/publish?type=1
                                    ">乐直播门户</a></li> 
        <li> <a id="type2" href="/portal/publish?type=2
                                    ">直播间</a></li> 
        <li> <a id="type3" href="/portal/publish?type=3
                                    ">微信群</a></li> 
        <li> <a id="type4" href="/portal/publish?type=4
                                    ">朋友圈</a></li> 
        <li> <a id="type5" href="/portal/publish?type=5
                                    ">微信公众号</a></li> 
       </ul> 
       <ul class="ul-filter fix"> 
        <li>价格：</li> 
        <li><a id="price0" href="/portal/publish?price=0
                                ">不限</a></li> 
        <li> <a id="price1" href="/portal/publish?price=1
                                    ">0-100元</a></li> 
        <li> <a id="price2" href="/portal/publish?price=2
                                    ">100-1000元</a></li> 
        <li> <a id="price3" href="/portal/publish?price=3
                                    ">1000元以上</a></li> 
       </ul> 
       <ul class="ul-filter fix"> 
        <li>地区：</li> 
        <li> <a id="city0" href="/portal/publish?city=
                                    ">不限</a></li> 
        <li> <a id="ca7005329b2311e6b31a02b27b4f1b99" href="/portal/publish?city=ca7005329b2311e6b31a02b27b4f1b99
                                    ">北京</a></li> 
        <li> <a id="e2c1ea929b2311e6b31a02b27b4f1b99" href="/portal/publish?city=e2c1ea929b2311e6b31a02b27b4f1b99
                                    ">上海</a></li> 
        <li> <a id="eb3ca59a9b2311e6b31a02b27b4f1b99" href="/portal/publish?city=eb3ca59a9b2311e6b31a02b27b4f1b99
                                    ">广州</a></li> 
        <li><a id="eb6ca6e69b2311e6b31a02b27b4f1b99" href="/portal/publish?city=eb6ca6e69b2311e6b31a02b27b4f1b99
                                    ">深圳</a></li> 
        <li><a id="ee4a15d89b2311e6b31a02b27b4f1b99" href="/portal/publish?city=ee4a15d89b2311e6b31a02b27b4f1b99
                                    ">成都</a></li> 
        <li><a id="other" href="/portal/publish?city=other
                                ">其他</a></li> 
       </ul> 
      </div> 
      <ul class="le-hardware-content"> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/attachment/20170815/e65c5f37814d4da39243482fa4f95012.jpg" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">菲律宾私人岛屿，世界珊瑚公园，自由潜水，度假包岛直播拍摄，真枪实弹射击</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥5000.00</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="f6cbbb2180b84c8b924db5f7b2657376"> </li> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/attachment/20170807/1de53b403f9742a1adbec3e3d9e76de2.jpg" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">广东广播电视台《品牌观察》栏目强势打造品牌新势力，服务企业提升品牌影响力</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥100.00</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="e660747669874711b83b8662ab0ed087"> </li> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/attachment/20170807/1872b0ddff074257ad1554ed3de25019.png" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">广东广播电视台《品牌观察》栏目强势打造品牌新势力，服务企业提升品牌影响力</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥100.00</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="71faaa53bd1d4c53a743c8497ad8c97e"> </li> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/attachment/20170807/690145bc2db9439093abf1229d8824ba.png" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">广东广播电视台《品牌观察》栏目强势打造品牌新势力，服务企业提升品牌影响力</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥100.00</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="c99d88571c0c47138f1582ba44c80bbd"> </li> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/attachment/20170731/523bd93819774fdfb152a93048556a5c.jpg" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">科旭直播平台</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥10.00</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="b9f10d2e2c99471bbd87975b1e653f20"> </li> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/attachment/20170726/0159a73bcaf644bb99d12a81e192c57f.jpg" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">直播｜探访新乡辉县五龙山响马河主题乐园</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥0.10</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="a1f16fa9785742a297900e1eef3dae32"> </li> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/attachment/20170726/1d8599cafeb14cb3a15b9c52ec0d0d3b.jpg" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">最合拍VL中国国际数码互动娱乐展览会官方直播</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥20.00</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="69fec6392c1d48978ad4f0bdc34645b2"> </li> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/attachment/20170724/4e7101424ef54e88898176af20514be9.jpg" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">笑傲江湖双面怪咖与您分享他的疯狂暑假</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥100.00</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="5ee94d57a48a448b9f06e04da35ed873"> </li> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/attachment/20170724/b514c371c6ee47ff8342551476aab062.jpg" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">【GRT品牌观察】直播间</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥100.00</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="049b624fb0b746a7949f62b6a91d3ba8"> </li> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/staticPublish/portal/img/activity-default.jpg" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">上海浦东最牛逼的商业综合体【长泰广场】渠道推广</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥1.00</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="2634782f43614b6786e94d4eecbe4876"> </li> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/attachment/20170722/8115ab507bac4417a4019df170349d53.jpg" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">中原琵琶风大讲堂</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥0.10</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="f0333d288e0c4bcd9c58d136a1ec6aeb"> </li> 
       <li> 
        <div class="le-loud-img"> 
         <img src="http://cdn.lezhibo.com/attachment/20170722/90f3c690b67f4568ad28b5364890c8c7.jpg" width="100%"> 
        </div> 
        <div class="le-loud-describe"> 
         <div class="le-loud-describe"> 
          <h2 style="width:65%;">秀如朋友圈</h2> 
          <p style="width:35%;padding-right:5px;box-sizing: border-box;">￥1.00</p> 
         </div> 
        </div> <input type="hidden" name="pcid" value="133aba4e850c49d0ac34dffc2bffbceb"> </li> 
      </ul> 
      <div class="le-pages"> 
       <a href="javascript:;" class="previous disabled">上一页</a> 
       <a href="javascript:;" class="active">1</a> 
       <a href="/portal/publish?page=2" class="">2</a> 
       <a href="/portal/publish?page=2" class="next">下一页</a> 
      </div> 
      <div class="clearfix"></div> 
      <div class="le-footer"> 
       <p>Copyright © 2015-2016 le.com.cn. All rights reserved.</p> 
      </div> 
     </div> 
    </div> 
   </div> 
  </div> 
  <script type="text/javascript" src="http://cdn.lezhibo.com/staticPublish/portal/layui/layui.js?cdnv=0.16"></script> 
  <script type="text/javascript" src="http://cdn.lezhibo.com/staticPublish/portal/layui/lay/dest/layui.all.js?cdnv=0.16"></script> 
  <script type="text/javascript" src="http://cdn.lezhibo.com/staticPublish/portal/js/jquery.min.js?cdnv=0.16"></script> 
  <script type="text/javascript" src="http://cdn.lezhibo.com/staticPublish/portal/js/jquery.form.min.js?cdnv=0.16"></script> 
  <script>
    var cdnPath="http://cdn.lezhibo.com";//cdn路径
    var globalNeedRefreshIndex = "";
    var globalNeedRefreshUrl = "";
    var needRefresh = false;

    function openLayer(url, title, func, isNeedRefreshThisPage) {
        var index = layer.open({
            type: 2,
            title: title,
            shadeClose: true,
            shade: 0.6,
            area: ['60%', '80%'],
            content: url,
            end: function () {
                location.reload();
            }
        });

        if (isNeedRefreshThisPage == true) {
            globalNeedRefreshIndex = index;
            globalNeedRefreshUrl = url;
        }

    }

    function layerInit() {
        $("[layer-href]").click(function () {
            if ("" == $(this).attr("layer-need-record")) {
                openLayer($(this).attr("layer-href"), $(this).attr("layer-title"), $(this).attr("layer-func"), true);
            } else {
                openLayer($(this).attr("layer-href"), $(this).attr("layer-title"), $(this).attr("layer-func"), false);
            }
        });

        $("[go-href]").click(function () {
            var href = $(this).attr("go-href");
            var newWind = $(this).attr("go-href-new");
            if (newWind == "true") {
                window.open(href);
            } else {
                window.location.href = href;
            }
        });


        $("[confirm-href]").click(function () {
            var href = $(this).attr("confirm-href");
            if ((typeof(href) == "undefined") || href == null || href == "") {
                return;
            }

            var title = $(this).attr("confirm-title");
            if ((typeof(title) == "undefined") || title == null || title == "") {
                title = "您确定执行该操作吗？"
            }
            //是否删除页面Tr 以避免刷新丢失未保存的其他信息
            var isRemoveTr = $(this).attr("isRemoveTr");
            var tr = $($(this).parents("tr")[0]);
            layer.confirm(title, {icon: 9, title: '确定操作'}, function (index) {
                    layer.close(index);
                    $.get(href, function (result) {
                        if (result.isOk) {
                            if(isRemoveTr=="yes") {
                                tr.remove();
                                return;
                            }
                            location.reload();
                        } else {
                            alert(result.message);
                        }
                    });
                },
                function (index) {
                    layer.close(index);
                });
        });


    }

    function headerFocus() {
        $("#nav-alliance").addClass("layui-this");
    }


    /*function initSidebarUrls() {

     $(".le-sidebar").find(".layui-nav-item").each(function () {
     var pid = $(this).attr("id");
     if (typeof(pid) == 'undefined' || null == pid) {
     return;
     }

     var href = $(this).children('a').attr("href");
     if ((typeof(href) != "undefined") && href.indexOf("?") == -1) {
     href = href + "?p=" + pid;
     } else {
     href = href + "&p=" + pid;
     }
     $(this).attr("class", "layui-nav-item");
     $(this).children('a').attr("href", href);
     });

     $("#market").attr("class", "layui-nav-item layui-this");
     }*/
    function initSidebarUrls() {
        $(".le-sidebar").find("dd").each(function () {
            var pid = $(this).attr("id");
            if (typeof(pid) == 'undefined' || null == pid) {
                return;
            }
            var href = $(this).children('a').attr("href");
            if ((typeof(href) != "undefined") && href.indexOf("?") == -1) {
                href = href + "?p=" + pid;
            } else {
                href = href + "&p=" + pid;
            }
            $(this).children('a').attr("href", href);
        });

        $("#publishMarket").attr("class", "layui-this");
        $("#market").attr("class", "layui-nav-item layui-nav-itemed ");
    }

    function setItem(){

        $(this).parent(".layui-nav-item").attr("class","layui-nav-item layui-nav-itemd");
    }

    var verification = {
        mobiel: function () {
            $mobile = $("input[validate='mobile']").val();
            var re = /^1\d{10}$/;
            if ((typeof($mobile) != "undefined") && !re.test($mobile)) {
                $("input[validate='mobile']").after('<p class="le-tips"><span style="color: red;width: 100%">请输入正确的手机号</span></p>');
                return false;
            }
        },
        email: function () {
            $email = $("input[validate='email']").val();
            var re = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
            if ((typeof($email) != "undefined") && !re.test($email)) {
                $("input[validate='email']").after('<p class="le-tips"><span style="color: red;width: 100%">请输入正确的邮箱</span></p>');
                return false;
            }
        },
        empty: function () {
            var $input = $("input[validate='empty']");
            for (var i = 0; i < $input.length; i++) {
                if ($input.eq(i).val().trim().length == 0) {
                    $("input[validate='empty']").eq(i).after('<p class="le-tips"><span style="color: red;width: 100%">输入不能为空</span></p>');
                    return false;
                }
            }

            var $textarea =$("textarea[validate='empty']");
            for(var i=0;i<$textarea.length;i++){
                if($textarea.eq(i).val().trim().length==0){
                    $("textarea[validate='empty']").eq(i).after('<p class="le-tips"><span style="color: red;width: 100%">输入不能为空</span></p>');
                    return false;
                }
            }
        },

        password: function () {
            $password = $("input[validate='password']").val();
            var re = /(.+){6,12}$/;
            if ((typeof($password) != "undefined") && !re.test($password)) {
                $("input[validate='password']").after('<p class="le-tips"><span style="color: red;width: 100%">请输入6到12位密码</span></p>');
                return false;
            }
        }
    }


    var regularVerify = {
        mobile: function (value) {
            var re = /^1\d{10}$/;
            if ((typeof(value) != "undefined") && !re.test(value)) {
                return false;
            }
        },
        email: function (value) {
            var re = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
            if ((typeof(value) != "undefined") && !re.test(value)) {
                return false;
            }
        },
        password: function (value) {
            var re = /(.+){6,12}$/;
            if ((typeof(value) != "undefined") && !re.test(value)) {
                return false;
            }
        },
        integer: function (value)     {
//                    var re = /^[1-9]\d*$/;
            var re = /^\d+$/;
            if ((typeof(value) != "undefined") && !re.test(value)) {
                return false;
            }
        },
        decimal: function (value) {
//                    var re = /^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$/;
            var re = /^[0-9]+\.{0,1}[0-9]{0,2}$/;
            if ((typeof(value) != "undefined") && !re.test(value)) {
                return false;
            }
        },
        empty: function (value) {
            if (value.trim().length == 0) {
                return false;
            }
        }
    }


    function leSubmit() {
        $("[le-submit]").click(function () {
            var $form = $(this).parents("form");
            var sfunc = $form.attr("success-func");
            var bfunc = $form.attr("before-func");
            $form.ajaxSubmit({
                type: "post",
                dataType: "json",
                beforeSend: function () {
                    if(bfunc != null){
                        if(false == eval(bfunc)){
                            return false;
                        }
                    }
                    $(".le-tips").remove();
                    if (false == verification.empty()) {
                        return false;
                    }
                    if (false == verification.mobiel()) {
                        return false;
                    }
                    if (false == verification.email()) {
                        return false;
                    }
                    if (false == verification.password()) {
                        return false;
                    }
                },
                success: function (result) {
                    if (sfunc != null) {
                        eval(sfunc);
                        return;
                    }

                    if (result.isOk) {
                        parent.isUpdateData = true;
                        parent.layer.closeAll();
                    } else {
                        alert(result.message);
                    }
                },
                error: function () {
                    alert("信息提交错误");
                }
            });
        })
    }

    //对日期选择范围的控制
    //对id为begin-date和end-date的日期选择控件进行控制
    function verifyDate() {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            var start = {
                min: '2006-01-01 00:00:00',
                max: '2099-06-16 23:59:59',
                istoday: false,
                choose: function (datas) {
                    end.min = datas;    //开始日选好后， 重置结束日的最小日期
                    end.start = datas;  //将结束日的初始值设定为开始日
                }
            };

            var end = {
                min: '2006-01-01 00:00:00',
                max: '2099-06-16 23:59:59',
                istoday: false,
                choose: function (datas) {
                    start.max = datas;  //结束日选好后, 重置开始日的最大日期
                }
            };

            $('.begin-date').click(function () {
                start.elem = this;
                laydate(start);
            });
            $('.end-date').click(function () {
                end.elem = this;
                laydate(end);
            });

        });
    }

    layui.use('element', function(){
        var element = layui.element(); //Tab的切换功能，切换事件监听等，需要依赖element模块
    });
    //    最小高度控制
    function fix() {
        var head_height = $('.le-head').outerHeight();
        var window_height = $(window).height();
        var content_height = $('.le-content').outerHeight();
        var sidebar_height = $(".le-sidebar").height();

        if(content_height < (window_height - head_height)){
            $(".le-content").css('min-height', (window_height - head_height));
        }else{
            $(".le-sidebar").css('min-height', content_height);
            sidebar_height = content_height;
        }

        if(sidebar_height < (window_height - head_height)){
            $(".le-sidebar").css('min-height', (window_height - head_height));
        }


    }
    fix();
    layerInit();
    headerFocus();
    initSidebarUrls();
    leSubmit();
    verifyDate();
    //<script>
    layui.use('element', function () {
        var element = layui.element(); //Tab的切换功能，切换事件监听等，需要依赖element模块
    });
    //    最小高度控制
    function fix() {
        var head_height = $('.le-head').outerHeight();
        var window_height = $(window).height();
        var content_height = $('.le-content').outerHeight();
        var sidebar_height = $(".le-sidebar").height();

        if (content_height < (window_height - head_height)) {
            $(".le-content").css('min-height', (window_height - head_height));
        } else {
            $(".le-sidebar").css('min-height', content_height);
            sidebar_height = content_height;
        }

        if (sidebar_height < (window_height - head_height)) {
            $(".le-sidebar").css('min-height', (window_height - head_height));
        }
    }

    fix();
    //    最小高度控制

    $(document).ready(function(){
        var price           ;
        var type           ;

        var city =$.trim('');
        if(price==undefined && type == undefined && city == undefined){
            $('#type0').addClass("le-red");
            $('#price0').addClass("le-red");
            $('#city0').addClass("le-red");
        }
        if(type == undefined && city == ''){
            $('#type0').addClass("le-red");
            $('#city0').addClass("le-red");
        }
        if(price==undefined && city == ''){
            $('#price0').addClass("le-red");
            $('#city0').addClass("le-red");
        }
        if(price==undefined && type == undefined){
            $('#price0').addClass("le-red");
            $('#type0').addClass("le-red");
        }
        if(price==undefined){
            $('#price0').addClass("le-red");
        }
        if(city==''){
            $('#city0').addClass("le-red");
        }else{
            $("#" + city).addClass("le-red");
        }

        if(type==undefined){
            $('#type0').addClass("le-red");
        }

        $("#type" + type).addClass("le-red");
        $("#price" + price).addClass("le-red");



        //发布资源
        $("#publicChannel").on("click",function () {
            layer.open({
                type: 2,
                title: '选择资源',
                // shadeClose: true,
                shade: 0.1,
                area: ['600px', '200px'],
                content: '/portal/publish/channelChoose',
            });
        })

        //投放资源
        $(".le-hardware-content li").click(function(){
           var $pcid= $(this).find("input[name='pcid']").val();
           if($pcid&&$pcid!=''){
               layer.open({
                   type: 2,
                   title: '投放资源',
                   // shadeClose: true,
                   shade: 0.1,
                   area: ['900px', '560px'],
                   content: '/portal/publish/publishChannelPost?id='+$pcid,
               });
           }else{
               alert("发行资源参数错误");
           }
        })
    });
    //</script>    
 </body>
</html>